package gist.generics;

/**泛型的用法
 * Created by Administrator on 2017/5/5.
 */
public  class FX<T> {
    private T ob;
    public  FX(T ob){
        this.ob=ob;
    }
    public  T getOb(){
        return ob;
    }
    public void  showType(){
        System.out.println("T的实际类型是："+ob.getClass().getName());
    }

    public static void main(String[] args) {
        FX<Integer> intOb=new FX<Integer>(100);
        intOb.showType();
        System.out.println("value="+intOb.getOb());
        System.out.println("======================");

        FX<String> stringOb=new FX<String>("字符串");
        stringOb.showType();
        System.out.println("value="+stringOb.getOb());
        System.out.println("======================");
    }
}
